﻿//using Org.BouncyCastle.Cms;
//using PHMEE.Entities.MqttDt.CollectPara;
//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;
//using Volo.Abp.Domain.Entities;
//using Volo.Abp.Domain.Repositories;
//using Volo.Abp.Domain.Services;

//namespace PHMEE
//{
//    /// <summary>
//    /// CollectParameter相关的领域服务
//    /// </summary>
//    public class CollectParameterManager : DomainService, ICollectParameterManager
//    {
//        private readonly IRepository<SysPara, Guid> _sysparaRepository;
//        private readonly IVibChannelParaRepository _vbChannelParaRepository;

//        public CollectParameterManager(IRepository<SysPara, Guid> sysparaRepository, IVibChannelParaRepository vbChannelParaRepository)
//        {
//            _sysparaRepository = sysparaRepository;
//            _vbChannelParaRepository = vbChannelParaRepository;
//        }
//        /// <summary>
//        /// 查询VibChannelPara集合
//        /// </summary>
//        /// <param name="collecterCode"></param>
//        /// <returns></returns>
//        /// <exception cref="EntityNotFoundException"></exception>
//        public async Task<List<VibChannelPara>> GetVibChannelParasAsync(string collecterCode)
//        {
//            //获取请求系统参数的实体数据
//            var sysPara = await _sysparaRepository.FirstOrDefaultAsync(x => x.CollectorCode == collecterCode);
//            if (sysPara == null)
//            {
//                throw new EntityNotFoundException("没有对应的SysPara数据");
//            }

//            //查询请求采集参数的集合
//            var collectPara = await _collectParameterRepository.FirstOrDefaultAsync(cp => cp.SysParaID == sysPara.Id);
//            if (collectPara == null)
//            {
//                throw new EntityNotFoundException("没有对应的CollectParameter数据");
//            }
//            // 查询所有与CollectParameter ID关联的VibChannelPara
//            return await _vbChannelParaRepository.GetByVibChannelWithMqttAsync(collectPara.Id);
//        }
//        ///// <summary>
//        ///// 更新策略参数
//        ///// </summary>
//        ///// <param name="sysParaId"></param>
//        ///// <returns></returns>
//        //public async Task<CollectParameter> UpdateColletorParameterAsync(Guid sysParaId)
//        //{
//        //    var collectorPara = await _collectParameterRepository.GetByCollectWithMqttAsync(sysParaId);
//        //    return collectorPara;
//        //}
//    }
//}
